<template>
	<view>
		<view :style="'background-image: url('+get_img+bgFunc()+');'" class="image"></view>
		<view>
			<view class="title" style="padding-top: 60rpx;">我的邀请</view>
		</view>
		<view class="_a" v-for="(item,index) in list" :key='index'>
			<view class="_b">
				<view class="_b_img">
					<image :src="item.avatar"></image>
				</view>
				<view class="_b_p">
					<p>{{item.nickname}}</p>
				</view>
			</view>
			<view class="_c">
				<!-- <p class="_c_">+20g饲料</p> -->
				<p class="_c_time">{{item.created_at}}</p>
			</view>
			<view>
				<u-line color="#fff" hairline="false"></u-line>
				<!-- <u-line color="#fff" hairline="false"></u-line> -->
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				get_img:this.$get_img,
				sys:{},
				list: [],
				page:1,
				num:10,
				reach:false,

			}
		},
		onReachBottom(){
			if(!this.reach){
				this.page++
				this.get_data()
			}
		},
		onLoad() {
			this.sys=uni.getStorageSync("sys")
			this.get_data()
		},
		methods: {
			bgFunc() {
				return this.sys.invite_bg != '' ? this.sys.invite_bg : this.sys.sys_background
			},
			get_data(){
				let that=this
				this.$model.get("user/get_my_invite?page="+this.page+"&num="+this.num).then(res=>{
					if(res.code==200){
						if(res.data.data.length==0){
							that.reach=true
						}
						
						res.data.data.forEach(function(value){
							that.list.push(value)
						})
					}
				})
			}
		}
	}
</script>

<style>
	.image{
		background-repeat: no-repeat;
		background-size: cover;
		background-attachment: fixed;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		z-index: -1;
	}

	.title {
		color: #fff;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		letter-spacing: 10rpx;
		font-size: 45rpx;
	}

	._a {
		margin-top: 40rpx;
	}

	._b {
		float: left;
		margin: 10rpx 20rpx 10rpx 20rpx;
	}

	._b_img {
		width: 110rpx;
		float: left;
	}

	._b_img image {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50rpx;
		margin: 5rpx 5rpx 0 0;
	}

	._b_p {
		float: right;
		margin-top: 30rpx;
	}

	._b_p p {
		width: 250rpx;
		float: right;
		margin-right: 40rpx;
		color: #fff;
	}

	._c {
		width: 200rpx;
		height: 100rpx;
		float: left;
		margin: 10rpx 0 10rpx 100rpx;
	}

	._c_ {
		height: 50rpx;
		width: 200rpx;
		font-size: 30rpx;
		margin-top: 25rpx;
		color: #ffff00;
	}

	._c_time {
		height: 50rpx;
		font-size: 25rpx;
		color: #fff;
	}
</style>
